import { ApiPropertyOptional } from '@nestjs/swagger'
import { modelOptions, prop } from '@typegoose/typegoose'

//在数据库默认添加两个时间字段 
@modelOptions({
  schemaOptions:{
    timestamps:true
  }
})
export class User {
  //接口注释 和默认值
  @ApiPropertyOptional({description:'用户名',example:'user'})
  @prop()
  username:string
  @ApiPropertyOptional({description:'密码',example:'password'})
  @prop()
  password:string
}